package cn.psh;

import cn.psh.org.domain.Department;
import cn.psh.org.domain.Detail;
import cn.psh.org.domain.Employee;
import cn.psh.org.service.impl.DepartmentServiceImpl;
import cn.psh.org.service.impl.DetailServiceImpl;
import cn.psh.org.service.impl.EmployeeServiceImpl;
import cn.psh.pet.domain.Pet;
import cn.psh.pet.domain.PetType;
import cn.psh.pet.mapper.PetTypeMapper;
import cn.psh.system.domain.Menu;
import cn.psh.system.service.impl.MenuServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
//Springboot的测试
@SpringBootTest(classes = app.class)
public class test01 {
    @Autowired
    private DepartmentServiceImpl departmentService;

    @Autowired
    private DetailServiceImpl detailService;

    @Autowired
    private MenuServiceImpl menuService;

    @Autowired
    private EmployeeServiceImpl employeeService;


    @Autowired
    private PetTypeMapper petTypeMapper;

    @Test
    public void queryAll() throws Exception {
        List<Department> departments = departmentService.queryAll();
        departments.forEach(System.out::println);

    }

    @Test
    public void test() throws Exception {
        final List<Detail> details = detailService.queryAll();
        details.forEach(System.out::println);
    }
    @Test
    public void test4() throws Exception {
        final List<Employee> employees = employeeService.queryAll();
        employees.forEach(System.out::println);
    }

    @Test
    public void test1() throws Exception {
        final List<Menu> menus = menuService.queryAll();
        menus.forEach(System.out::println);

    }

    @Test
    public void test3() throws Exception {
        final List<PetType> petTypes = petTypeMapper.queryAll();
        petTypes.forEach(System.out::println);

    }

    @Test
    public void test6() throws Exception {
       String  resources = "/group1/M00/00/02/CgAIC2KevEeAX2T4AAEUusLjqqk161.png,/group1/M00/00/02/CgAIC2KevEeAX2T4AAEUusLjqqk162.png";
        String[] split = resources.split(",");
    }

}
